import { ajax } from "@/utils/ajax";

export interface GroupStats {
    id?: number | null;
    name: string;
    bornTime?: string | null;
    profile?: string | null;
    hot?: number | null;
    number?: number | null;
    teacherName?: string | null;
    createTime?: string | null;
    logCount?: number | null;
}

export interface GenderData {
    type: string;
    value: number;
}

export interface GradeData {
    grade: string;
    count: number;
}

export interface TopGroup {
    id: number | null;
    name: string;
    value: number;
}

export interface DashboardData {
    numberGroup: GroupStats[];
    teacher: number;
    student: number;
    log: number;
    logGroup: GroupStats[];
    hotGroup: GroupStats[];
    gradeCount: GradeData[];
    group: number;
    sexCount: Array<{
        sex: boolean;
        count: number;
    }>;
}

export interface ApiResponse<T = any> {
    code: number;
    msg: string;
    data: T;
}

export const getDashboardData = () => {
    return ajax.get("/data/getData");
};